﻿using DotNet5.Mvc.Common;
using FreeSql;
using System;
using System.Linq.Expressions;

namespace DotNet5.Mvc.Repositories
{
    public partial interface IBaseRepositories<T> where T : class, new()
    {
        ISelect<T> GetModelsAll();

        ISelect<T> GetModels<type>(bool isAsc, Expression<Func<T, type>> orderByExpression, Expression<Func<T, bool>> whereExpression);

        PageObject<T> GetModelsByPage<type>(int page, int limit, bool isAsc, Expression<Func<T, type>> orderByExpression, Expression<Func<T, bool>> whereExpression);

        T GetModelsById(int id);

        void Create(T t);

        void Update(T t);

        void Delete(T t);

        void DeleteById(string[] id);

    }
}
